home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993…ch: Other People's Memory / ADC Developer CD (1993-03) (''Other People's Memory'')_iso / Dev.CD Mar 93.iso / Tools & Apps / Misc. Utilities / Installer 3.4 / Examples - Installer 3.4 / SimpleEasyNCustom.r < prev    next >
Encoding:
Text File  |  1992-09-21  |  6.4 KB  |  171 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2.  *
  3.  *    Apple Macintosh Developer Technical Support
  4.  *
  5.  *  Installer 3.2 sample: simple installation (Supports Easy and Custom Installation)
  6.  *
  7.  *    File:        SimpleEasyNCustom.r -    Rez Source
  8.  *
  9.  *    by:            Jon Zap
  10.  *  updated for use with Installer 3.4 by: Rich Kubota 9/1/92
  11.  *
  12.  *    Copyright © 1991 Apple Computer, Inc.
  13.  *    All rights reserved.
  14.  *
  15.  *------------------------------------------------------------------------------
  16.  *
  17.  * Install application "TeachText" into the folder "Root":Installed Application.
  18.  * It demonstrates both Easy and Custom Installation.  For the Easy Installation
  19.  * it checks the amount of target system memory and will not do the installation
  20.  * if there is less than 1mb. 
  21.  *----------------------------------------------------------------------------*/
  22.  
  23. #include "Types.r"                    /* for the ICON resource */
  24. #include "InstallerTypes.r"
  25.  
  26. /* You can build and complete the script with the following lines:
  27. # Note: set up floppies with the appropriate names and contents before running scriptcheck
  28. # or set up folders with the same names and contents as the floppies
  29. # put these folders in the same folder as the script or at the root directory of same disk
  30.  
  31.     rez -o "SimpleEasyNCustom" -t 'bbkr' -c 'bbkr' "SimpleEasyNCustom.r"
  32.     setfile -a i "SimpleEasyNCustom"        #mark Inited
  33.     scriptcheck -p "SimpleEasyNCustom"
  34. */
  35.  
  36. /* put a 1 in the creation date field of source 'infs' to have ScriptCheck set date */
  37. #define kScriptCheckSetsDate    0x01
  38. #define kMinMemMB                01    /* memory needed to install (UPDATE Error Message if changed!)*/
  39.  
  40. /* Definitions for the rules */
  41. #define rlCheckMemSize            1000
  42. #define rlOutputMemSizeError    1001
  43.  
  44. /* Defines for the file spec atoms (specifications for source and destination files) */
  45. #define fsSourceProgram            2000
  46. #define fsTargetProgram            2001
  47.  
  48. /* This is the name of the source disk */
  49. #define ProgramDisk "Program Disk:"
  50.  
  51. /* where we want to install our file. */
  52. #define TargetPath    ":Installed Application:"
  53.  
  54. /* Definition for the package. */
  55. #define pkTheProgram            3000
  56.  
  57. /* Definition for the file atom */
  58. #define faProgram                4000
  59.  
  60. /* Definition for the package comment resource */
  61. #define cmtTheProgram            5000
  62.  
  63. /* September 1, 1992 is the current release date I put in 'icmt' rsrcs. ScriptCheck will convert */
  64. /* this value to a LongInt seconds value needed by the Installer. */
  65. #define currentReleaseDate        9011992        
  66. #define currentVersion            101     /* Version 1.0.1 goes in the 'icmt' rsrc */
  67.  
  68. #define iconTheProgram            5100
  69.  
  70. /************************** Easy Install Rule resources **********************************/
  71. resource 'infr' (1) {
  72.     format0  {{
  73.         pickFirst,    {rlCheckMemSize, rlOutputMemSizeError},     /* Select only one of these rules */
  74.     }};
  75. };
  76.  
  77. resource 'inrl' (rlCheckMemSize) {
  78.     format0 {{
  79.         /* If the system has at least kMinMemMB megs of memory, then add the package */
  80.         checkMinMemory {kMinMemMB},
  81.         addUserDescription {"Click Install button to install\n"}, /* message to appear in Easy Install screen */
  82.         addUserDescription {"• TeachText\n"},    /* message to appear in Easy Install screen */
  83.         addPackages {{pkTheProgram}}            /* we're installing the program */
  84.     }};
  85. };
  86.  
  87. resource 'inrl' (rlOutputMemSizeError) {
  88.     format0 {{
  89.         /* This error message will be displayed on the Easy Install screen if this rule */
  90.         /* fires.  It fires if the first rule in this pickFirst group does not fire */
  91.         
  92.         reportSysError {"To do installation you need:\n\n"},
  93.         reportSysError {"• At least 1 megabyte of memory\n"}    /*if kMinMemMB changes FIX HERE! */
  94.     }};
  95. };
  96.  
  97. /***************************** Package Resources ************************************************/
  98. resource 'inpk' (pkTheProgram) {
  99.     format0 {
  100.         showsOnCustom,                 /* Package appears in the Custom Install display */
  101.         removable,                    /* Package can be removed */
  102.         dontForceRestart,            /* no need to reboot after live install */
  103.         cmtTheProgram,                 /* package's 'icmt' resource id */
  104.         0,                            /* Package size (filled in by ScriptCheck) */
  105.         "TeachText", {                /* package name for package that shows on custom */
  106.             'infa', faProgram;
  107.         }
  108.     }
  109. };
  110.  
  111. /***************************** Comments ************************************************/
  112. resource 'icmt' (cmtTheProgram) {
  113.     currentReleaseDate,
  114.     currentVersion,
  115.     iconTheProgram,
  116.     "This package contains TheProgram. "
  117. };
  118.  
  119. resource 'ICON' (iconTheProgram) {
  120.         $"0430 4000 0A50 A000 0B91 1002 0822 0803"
  121.         $"1224 0405 2028 0209 4010 0111 800C 00A1"
  122.         $"8003 FFC2 7E00 FF04 0100 7F04 0300 1E08"
  123.         $"04E0 000C 08E0 000A 10E0 0009 08C0 0006"
  124.         $"0487 FE04 0288 0104 0188 0084 0088 0044"
  125.         $"0088 0044 0088 00C4 0110 0188 0228 0310"
  126.         $"01C4 04E0 0002 0800 73BF FBEE 4CA2 8A2A"
  127.         $"40AA AAEA 52AA AA24 5EA2 8AEA 73BE FB8E",
  128. };
  129.  
  130.  
  131. /********************************************* File Specs ******************************************/
  132. /* Source File Specs */
  133. resource 'infs' (fsSourceProgram) {
  134.     'APPL',                                /* File Type */
  135.     'ttxt',                                /* Creator */
  136.     kScriptCheckSetsDate,                /* ScriptCheck fills in the creation date */
  137.     noSearchForFile,                    /* Do not search the source disk for the file */
  138.     typeCrMustMatch,                    /* file type and creator on source disk must match */
  139.     ProgramDisk"TeachText"                /* Path to the file */
  140. };
  141.  
  142. /* Target File Specs */
  143. resource 'infs' (fsTargetProgram) {
  144.     'APPL',                                /* File Type */
  145.     'ttxt',                                /* Creator */
  146.     0,                                    /* creation date not needed for target file specs */
  147.     noSearchForFile,                    /* Do not search the target disk for the file */
  148.     TypeCrMustMatch,                    /* not needed for target file specs */
  149.     TargetPath"TeachText"                /* destination Path */
  150. };
  151.  
  152. /******************************************** File Atoms ************************************************/
  153. resource 'infa' (faProgram) {
  154.     format0 {
  155.         deleteWhenRemoving,                /* Delete the file if remove (option-custom) is clicked    */
  156.         dontDeleteWhenInstalling,         /* don't need to predelete the target before copying new one */
  157.         copy,                             /* Copy the file to the destination */
  158.         leaveAloneIfNewer,                 /* do not Install this version, if newer one exists */
  159.         updateExisting,                 /* replace an existing copy, if mine is newer */
  160.         copyIfNewOrUpdate,                /* Copy whether the target file exists or not */
  161.         rsrcFork, dataFork,                /* Copy both forks of the file */
  162.         fsTargetProgram,                /* TARGET file spec for this file */
  163.         fsSourceProgram,                 /* SOURCE file spec for this file */
  164.         0,                                /* atom size (filled in by ScriptCheck) */
  165.         ""                                /* Atom Description (Installer will use file name) */
  166.     };
  167. };
  168.  
  169.  
  170.  
  171.